var template = ',,b,,3232,323B,bbbb,afs'
// console.log(template.split(/\b/))

console.log(template.replace(/3?=1/,9))